package com.probox.common.entity.vo.customer;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.probox.common.core.enums.SourcePlatformEnum;
import com.probox.common.core.text.Convert;
import com.probox.common.core.utils.DateUtils;
import com.probox.common.core.utils.StringUtils;
import com.probox.common.entity.utils.DictUtils;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

/**
 * 客户档案vo
 */
@Data
public class CustomerSubscribeVo implements Serializable {

    /**
     * 服务日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date subscribeDate;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startDate;

    public String getDateStr(){
        return DateUtils.formateToday(subscribeDate)+" "+DateUtils.formatTimes(startDate);
    }

    /**
     * 治疗师名字
     */
    private String technicianName;

    /**
     * 服务时长
     */
    private Long durationTime;

    /**
     * 耗卡金额
     */
    private BigDecimal price;

    /**
     * 客户诉求
     */
    private String customerRequirement;

    /**
     * 项目铺垫
     */
    private String projectBedding;

    /**
     * 皮肤问题
     */
    private String skinProblems;

    /**
     * 渠道来源
     */
    private String sourcePlatform;

    public String  getSourcePlatformStr(){
        HashMap dictCacheMap = DictUtils.getDictCacheMap("source_platform");
        return Convert.toStr(dictCacheMap.get(sourcePlatform), "");
    }


    /**
     * 能量
     */
    private String energy;

    /**
     * 客户图片
     */
    private String customerImages;

    public String[] getCustomerImagesStr() {
        if (!StringUtils.isEmpty(customerImages)) {
            return customerImages.split(",");
        }
        return new String[1];
    }


    private List<CustomerSubscribeDetailVo> customerSubscribeDetailVos;

}
